package com.dongxing.concyrrency.chapter8;

/**
 * @author XavierDong
 **/
public class OtherService {

    private final Object object = new Object();

    private final DeadLock deadLock;

    public OtherService(DeadLock deadLock) {
        this.deadLock = deadLock;
    }

    public void s1() {
        synchronized (object) {
            System.out.println("s1===============");
        }

    }

    public void s2() {
        synchronized (object) {
            System.out.println("s2===============");
            deadLock.m2();
        }
    }
}
